Option Public
Option Explicit
Sub Initialize
	'Notes客户端当前文档运行代理
	'set up error handler
	On Error Goto catch
	
	'变量定义
	Dim s As New NotesSession'当前进程
	Dim w As New NotesUIWorkspace'当前工作区
	Dim uidocCurrent As NotesUIDocument'当前工作区打开文档
	Dim docCurrent As NotesDocument'当前文档
	
	'变量初始化
	Set uidocCurrent = w.CurrentDocument
	Set docCurrent = uidocCurrent.Document
	
	Goto finally
catch:
	'log error
	Msgbox Erl & ":" & Error
	'resume to the final thing
	Resume finally
	
finally:
	'do the final thing
	
End Sub